﻿<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <form action="?" method="post">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <h5>
                        模版列表</h5>
                </div>
                <div class="widget-content">
                    <a href="@Url.Action("Info")" class="btn btn-success">添加</a>
                </div>
                <div class="widget-content">
                    <table class="table table-bordered table-striped with-check">
                        <thead>
                            <tr>
                                <th style="width: 400px">
                                    名称
                                </th>
                                <th>
                                    路径
                                </th>
                                @*                               <th>
                                    保存目录
                                </th>
                               <th>
                                    发布状态
                                </th>*@
                                <th style="width: 200px">
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (Template item in ViewBag.PagList.DataList)
                            {
                                <tr>
                                    <td>
                                        @item.Name
                                    </td>
                                    <td>
                                        @item.Path
                                    </td>
                                    @*                                 <td>
                                        @item.Directory
                                    </td>
                                 <td>
                                        @if (@item.IsRelease == "N")
                                        {
                                            <span class="label">待发布</span>
                                        }
                                        else
                                        {
                                            <span class="label label-success">已发布</span>
                                        }
                                    </td>*@
                                    <td style="text-align: center">
                                        @*<a class="btn btn-primary btn-mini" href="@Url.Action("Info", new { item.Id })">编辑</a>*@
                                        <a class="btn btn-primary btn-mini" href="@Url.Action("Edit", new { item.Id })">编辑</a>
                                        <input  type="button" value="删除" class="btn btn-danger btn-mini" onclick="DelArticle(@item.Id)" />
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                    @Html.Partial("_Paging")
                </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    //删除
    function DelArticle(id) {
        if (confirm("确认删除？")) {
            $("#LoadingBox").show();
            $.post('@Url.Action("Delete")', "id=" + id, function () {
                $("#LoadingBox").hide();
                //刷新页面，页码不变
                $("form").submit();
            });
        }
    }
</script>
